package com.kundi.dooradmin.service;

import com.kundi.dooradmin.entity.CooperationUnit;
import com.kundi.dooradmin.mapper.CooperationUnitMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author 赵恒
 * Date 2020/6/19
 */
@Service
public class CooperationUnitService {
    @Resource
    CooperationUnitMapper cooperationUnitMapper;

    public List<CooperationUnit> getAll() {
        return cooperationUnitMapper.selectAll();
    }

    public int insert(CooperationUnit cooperationUnit) {
        return cooperationUnitMapper.insertSelective(cooperationUnit);
    }

    public int update(CooperationUnit cooperationUnit) {
        return cooperationUnitMapper.updateByPrimaryKey(cooperationUnit);
    }

    public int delete(Integer id) {
        return cooperationUnitMapper.deleteById(id);
    }

    public CooperationUnit getUnitById(Integer id) {
        return cooperationUnitMapper.getUnitById(id);
    }
}
